/*
 * @lc app=leetcode.cn id=217 lang=cpp
 *
 * [217] 存在重复元素
 */
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <set>

using namespace std;
// @lc code=start
class Solution {
public:
    bool containsDuplicate(vector<int>& nums) {
        unordered_set<int> set;
        for(auto x: nums) {
            if(set.count(x) == 0) {
                set.insert(x);
            }else {
                return true;
            }
        }
        return false;
    }
};
// @lc code=end

